Skip to main content

is strictly a

Type

operator

Summary

Evaluates to true if the actual type of value is the specified type.

Syntax

<value> is strictly { nothing | a boolean | a number | an integer | a real | a string | a name | a binary string | an array | a sequence | a dictionary }

Description

Use the is strictly a operator to determine the true type of a value. The true type of a value is the representation which the engine is currently holding for it, without performing any implicit type coercion. The true type of a value can be one of the following:

  • nothing: no value, typically seen as < empty:::note[ boolean: either true or false, typically seen as the result of a comparison operator ]

number: a numeric value

  • integer: a numeric value internally represented as an integer value
  • real: a numeric value internally represented as a floating-point value
  • string: a piece of text (sequence of characters)
  • name: a string used as an array key or literal
  • binary string: a sequence of bytes
  • array: an associative array
  • sequence: a sequence array which has not been explicitly marked as a dictionary
  • dictionary: an array which has been marked to never be treated as a sequence even if it is a sequence

::: The is strictly a operator differs from is a in that it does not perform any type coercion. For example, x is a number would return true if x currently holds a number or if it holds a string which can be parsed as a number; whereas x is strictly a number only returns true if x currently holds a number.

Arrays can be marked as a sequence or as a dictionary by using the as a operators.

note

Whether a numeric value is strictly an integer, or strictly a real will depend on how it was generated. In particular, being strictly a real does not mean the value has a fractional part.

Parameters

NameTypeDescription

value

The expression which will be tested for its type.

Examples

"Hello World!" is strictly a string -- evaluates to true
1 + 200 is strictly a number -- evaluates to true
(100 is 100) is strictly a boolean -- evaluates to true
the compress of "Hello World!" is strictly a binary string -- evaluates to true
[ 1, 2 ] is strictly a sequence -- evaluates to true
([ 1, 2 ] as a dictionary) is strictly a sequence -- evaluates to false

operator: is not strictly a, is a, is not a, as a

Compatibility and Support

Introduced

LiveCode 8.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?